package yuekao7.ods;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import yuekao7.util.KafkaUtil;

public class ReadKafka {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        //1）使用附件提供sql脚本和jar包，将数据生成到logback.xml指定的目录下面；（5分）
        //2）使用Flume采集日志文件的数据，写入到kafka的topic-log主题中（5分）
        DataStreamSource<String> streamSource = env.addSource(KafkaUtil.kafkaSource("topic-log"));
        streamSource.print();
        env.execute();
    }
}
